import re
flag=1
s=input()
sum=0
dict1={}
while flag:
    if '#' in s:
        flag=0
        s=s[:s.find('#')]
    s=s.lower()
    s=re.split('[^\w+$]',s)#利用正则表达式分割字符串
    #print(s)
    for i in s:
        if i!='':
            i=i[:15]
            if i not in dict1.keys():
                sum += 1
                dict1[i]=1
            else:
                dict1[i]=dict1[i]+1
    if flag:
        s=input().strip()
print(sum)
x=int(sum*0.1)
if x==0:
    x=1
ls=dict(sorted(dict1.items(),key=lambda x:(-x[1],x[0])))
ls=list(ls.items())
for i in range(0,x):
    print(ls[i][1],end=":")
    print(ls[i][0])

